<!--
 * @Author: liaoxing
 * @Date: 2022-01-14 15:49:36
 * @LastEditors: liaoxing
 * @LastEditTime: 2022-01-17 09:43:43
 * @Description: liaoxing created
 * @FilePath: \品新集成管理系统\pin-xin-admin\src\views\quote\params\collapsItem\type.vue
-->
<template>

  <div class="collapsItemType">
    <el-form :model="dataInfo" ref="dataInfo" label-position="top">
      <el-form-item label="参数值" v-if="type == 'INPUT'">
        <el-input v-model="dataInfo.value"></el-input>
      </el-form-item>
      <el-form-item label="上传BOM文件" v-if="type == 'BOM'">
        <div class="uploadBox">
          <span style="margin-right: 10px; color: #246cff">{{ dataInfo.value }}</span>
          <FileUpload :typeName="'value'" @FileList="uploadFile"></FileUpload>
        </div>
      </el-form-item>
      <el-form-item label="物料单价" v-if="type == 'BOM_PRICE'">
        BOM_PRICE
      </el-form-item>
      <el-form-item label="物料" v-if="type == 'MASTER_MATERIAL'">
        MASTER_MATERIAL
      </el-form-item>
      <el-form-item label="工治具" v-if="type == 'FIXTURE'">
        <Fixture></Fixture>
      </el-form-item>
      <el-form-item label="辅料" v-if="type == 'SLAVE_MATERIAL'">
        <SlaveMaterial></SlaveMaterial>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import FileUpload from '@/components/FileUpload2'
import Fixture from './fixture.vue'
import SlaveMaterial from './slaveMaterial.vue'
export default {
  name: "collapsItemType",
  props: ["type"],
  components: {FileUpload, Fixture, SlaveMaterial},
  data () {
    return {
      dataInfo: {
        value: ""
      }
    }
  },
  methods: {
    uploadFile (data) {
      this.dataInfo.value = "temp"
    }
  }
}
</script>

<style lang="less">
.collapsItemType{
  padding: 20px;
  border-radius: 8px;
  border: 1px dashed rgb(223, 223, 223);
  .uploadBox{
    width: 100%;
  }
}
</style>